<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex flex-wrap align-center justify-between benben-position-layout flex evaluation_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center evaluation_fd0_0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <image class='evaluation_fd0_0_c0'  mode="aspectFit"  :src='STATIC_URL+"234.png"'></image>
</view>
<text class='evaluation_fd0_1'  >评价</text>
    <view   class='flex flex-wrap align-center evaluation_fd0_0'      >
        </view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
        <benben-goods-evaluate class='evaluation_flex_evaluate_1':goods-list.sync='dataDetails.order_goods_list' v-model='goods_comment' >
        </benben-goods-evaluate>
    <view class="flex flex-direction flex-wrap align-center justify-center benben-position-layout flex evaluation_flex_2"    >
        <button class='evaluation_fd2_0'  @tap.stop="handleSubmitFunc()"  >提交</button>

        </view>
<view :style="{height: '88rpx'}"  ></view>
    
    
        </view>
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        
        
        data(){
			return {"dataDetails":{"aid":"","order_sn":"","order_money":"","payable_money":"","coupon_id":"","coupon_money":"","send_time":"","receive_time":"","pay_time":"","discount_money":"","create_time":"","pay_type":"","status":"","pay_type_str":"","order_info":{"receiver_mobile":"","receiver_address":"","receiver_name":"","remark":"","province":"","city":"","district":"","sex":"","label_name":"","express_price":"","pickup_code":"","pickup_img":""},"order_goods_list":[],"shop_info":{"aid":"","store_name":"","store_logo":"","store_logo_id":""},"btn_list":{"cancel_order":"","go_pay":"","remind_send":"","remind_already":"","apply_invoice":"","view_invoice":"","apply_refund":"","view_logistics":"","confirm_receive":"","evaluate":"","delete_order":""},"is_multiple_package":"","order_type":"","advance_sn":"","usermerchant_id":"","discount_str":"","surplus_receive_time":"","group_info":{"join_timeout":"","activity_status":"","group_members_nums":"","join_number":""},"group_user":[],"real_money":""},"goods_comment":"","text":"shenqingchengg","id":"1018"};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {id}=options
if (id !== undefined) this.id = id
this.queryDetailsFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //订单-订单详情
                async queryDetailsFunc(){
                        //请求方法
    //数据验证
    
  let datadataDetails = await this.$api.post(global.apiUrls.post62c92b9d5ada3, {
    order_id:this.id
  });
  
  if (datadataDetails.data.code != 1) {
    this.$message.info(datadataDetails.data.msg);
    return
  } 
  let infodataDetails = datadataDetails.data;
  this.dataDetails = infodataDetails.data
  
                },
                //发布评论
                async handleSubmitFunc(){
                        var flag=true
				var objData =JSON.parse(this.goods_comment)
				 objData.forEach(it=>{
					 it.content = it.content.trim();
					 if(it.content==''){
						 flag=false
						 return
					 }
				 })
				 if(flag==false){
					 this.$message.info('请输入您的评价')
					 flag=true
					 return
				 }
    //请求方法
    //数据验证
    
  let data64218d79d9401 = await this.$api.dbPost(global.apiUrls.post64218d79d9401, {
    order_id:this.id,goods_comment:this.goods_comment
  });
  if(!data64218d79d9401) return
  if (data64218d79d9401.data.code != 1) {
    this.$message.info(data64218d79d9401.data.msg);
    return
  } 
  
  
  
                    this.$message.info('评论成功');
                uni.$emit('shenqingchengg',this.text)
                setTimeout(()=>{
                    this.$urouter.navigateBack(1);
      },500)
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#F8F8F8;background-size: 100% auto;
        }
    .evaluation_flex_0{
        background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:11;top:0rpx;background-size:100% auto !important;
    }
    .evaluation_fd0_1{
        color:#333333;font-size:36rpx;font-weight:500;line-height:50rpx;
    }
    .evaluation_fd0_0_c0{
        width:20rpx;height:36rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .evaluation_fd0_0{
        width:100rpx;height:88rpx;
    }
    .evaluation_flex_evaluate_1{
        --star-color:rgba(230, 230, 230, 1);--star-size:28rpx;--active-star-color:rgba(255, 127, 0, 1);--checked-activer-color:var(--benbenFontColor5);--checked-size:32rpx;
    }
    .evaluation_flex_2{
        width:750rpx;height:88rpx;overflow:hidden;z-index:11;bottom:calc(32rpx + var(--window-bottom));
    }
    .evaluation_fd2_0{
        background:var(--benbenbgColor7);border-radius:44rpx 44rpx 44rpx 44rpx;font-size:32rpx;color:#fff;width:686rpx;height:88rpx;line-height:88rpx;
    }
</style>